home *** CD-ROM | disk | FTP | other *** search
- #include "CITGroup.h"
- #include "CITText.h"
- #include "CITButton.h"
-
- CITApp Application;
-
- CITWorkbench DemoScreen;
- CITWindow DemoWindow;
- CITVGroup group;
- CITText text;
- CITButton quitButton;
- CITButton okButton;
-
- void CloseEvent();
- void QuitEvent(ULONG ID,ULONG eventFlag);
-
- int main(void)
- {
- BOOL Error=FALSE;
-
- //DemoScreen.DefaultFont("CGTimes.font",24,24);
- DemoScreen.InsObject(DemoWindow,Error);
- DemoWindow.Position(WPOS_CENTERSCREEN);
- DemoWindow.CloseGadget();
- DemoWindow.DragBar();
- DemoWindow.SizeGadget();
- DemoWindow.DepthGadget();
- DemoWindow.IconifyGadget();
- DemoWindow.Caption("CITGadgets");
- DemoWindow.CloseEventHandler(CloseEvent);
- //DemoWindow.DefaultFont("CGTimes.font",24,24);
- DemoWindow.InsObject(group,Error);
- group.BevelStyle();
- //group.BevelLabel("En tekst");
- group.InsObject(text,Error);
- text.Text("Text Gadget");
- group.InsObject(okButton,Error);
- okButton.Text("Ok");
- group.InsObject(quitButton,Error);
- quitButton.Font("CGTimes.font",24,24);
- quitButton.Text("Quit");
- quitButton.EventHandler(QuitEvent);
-
- Application.InsObject(DemoScreen,Error);
-
- // Ok?
- if( Error )
- return 10;
-
- Application.Run();
-
- return 0;
- }
-
- void QuitEvent(ULONG ID,ULONG eventFlag)
- {
- Application.Stop();
- }
-
- int repeatCount = 0;
-
- void CloseEvent()
- {
- BOOL Error=FALSE;
-
- repeatCount++;
-
- switch( repeatCount )
- {
- case 1:
- //DemoWindow.Position(50,50);
- Application.RemObject(DemoScreen);
- //Delay(100);
-
- DemoScreen.Display(DEF_MONITOR);
- Application.InsObject(DemoScreen,Error);
- break;
- case 2:
- DemoWindow.Size(300,180);
- break;
- default:
- Application.Stop();
- break;
- }
- }
-